Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Check in public for matching webpackShims #14

Closed
wants to merge 3 commits into from

Conversation

w33ble
Copy link
Contributor

@w33ble w33ble commented May 31, 2017

Closes #13

Check for a matching webpackShims path, starting at the plugin root, walk all the way to the requesting file, then check Kibana's root. Stops as soon as it finds a match, so in most cases, only the first condition is needed.

also simlify the webpackShim checking a bit by using reduce
index.js Outdated
const baseSource = sourceParts.pop();

const pluginShimPaths = [
path.join(rootPath, 'webpackShims', ...sourceParts),
Copy link
Contributor

@spalger spalger May 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The webpackShims directory could be in any directory relative to the file up to the root, so this needs to check for webpackShims directories starting at the basedir of the requested file up to the root. The console plugin, for instance, has it's own webpackShims directory, and any directory can have a webpackShims directory just like it can have a node_modules directory.

Copy link
Contributor Author

@w33ble w33ble May 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The webpackShims directory could be in any directory relative to the file up to the root

I did not know that. That makes resolution a bit trickier. I'm betting there code in Kibana that we can borrow here for the resolution. In any event, this PR will need to be updated then.

w33ble added 2 commits May 31, 2017 15:41
check for a matching webpackShims path, starting at the plugin root, walk all the way to the requesting file, then check kibana's root
@spalger
Copy link
Contributor

spalger commented Jun 1, 2017

Superseded by #15

@spalger spalger closed this Jun 1, 2017
@w33ble w33ble deleted the fix/deep-shim-resolve branch December 11, 2017 23:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants